package com.HW.Search;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

/**
 * @ClassName : TArrayTop3
 * @Author : kele
 * @Date: 2023/11/5 15:11
 * @Description : 数组组成的最小数字
 */
public class TArrayTop3 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        handle(sc.nextLine());

    }

    public static void handle(String string) {

        String[] split = string.split(",");

        Arrays.sort(split, Comparator.comparingInt(Integer::parseInt));

        String[] arr = Arrays.copyOfRange(split, 0, Math.min(3, split.length));

        Arrays.sort(arr, (o1, o2) -> (o1 + o2).compareTo(o2 + o1));

        for (String s : arr) {
            System.out.print(s);
        }
        System.out.println();


    }

}
